//
//  NSDictionary+Extension.h
//  YunDaHome-iOS
//
//  Created by 刘权 on 2020/1/15.
//  Copyright © 2020 YunDa. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSDictionary (Extension)

/// 是否存在key
- (BOOL)j_hasKey:(id)key;

/// 安全地get string
- (NSString *)j_stringForKey:(id)key;

/// 安全地get number
- (NSNumber *)j_numberForKey:(id)key;

/// 安全地get integer，如果取值失败，返回-1
- (NSInteger)j_integerForKey:(id)key;

/// 安全地get float，如果取值失败，返回0.0
- (float)j_floatForKey:(id)key;

/// 安全地get CGPoint
- (CGPoint)j_pointForKey:(id)key;

/// 安全地get CGSize
- (CGSize)j_sizeForKey:(id)key;

/// 安全地get CGRect
- (CGRect)j_rectForKey:(id)key;

/// 将url参数转换成NSDictionary
+ (NSDictionary *)j_dictionaryWithURLQuery:(NSString *)query;

@end

NS_ASSUME_NONNULL_END
